// 车险表单加载模块配置
const orderInfo = () => import("@/components/ivew_components/car_form_order_info/index.vue");
const carPersonalInfo = () => import('@/components/ivew_components/car_personal_info/index.vue');
const carPlan = () => import('@/components/ivew_components/car_plan/index.vue');
const carInfo = () => import('@/components/ivew_components/car_info/index.vue');
const carCharging = () => import('@/components/ivew_components/car_charging/index.vue');

const carFormDetaild = () => import('@/components/ivew_components/car_form_detailed/index.vue')


// 类型检测
function buildStoreMethod(key:formInf.storeMethod):formInf.storeMethod{
    return key;
}


const formReadonly = [

    {
        name: 'carFormDetaild',
        component: carFormDetaild,
        propsData: {
            data: {
                storePath: 'carFormStore/orderData',
                storeMethod: buildStoreMethod('state'),
            },
            carUploadList: {
                storePath: 'carFormStore/carUploadList',
                storeMethod: buildStoreMethod('state'),
            },
            chargingData: {
                storePath: 'carFormStore/chargingData',
                storeMethod: buildStoreMethod('state'),
            },
            hasKeys:{
                storePath: 'carFormStore/syChargingHasKeys',
                storeMethod: buildStoreMethod('getters'),
            },
            chargingSelectedCompany:{
                storePath: 'carFormStore/chargingSelectedCompany',
                storeMethod: buildStoreMethod('getters'),
            }
        },
        layout:{
            'grid-row': '1/2',
            'grid-column': '1/5',
        },
        style:{}
    },

    
]


const formEdit =  [
    {
        name: 'orderInfo',
        component: orderInfo,
        propsData: {
            data: {
                storePath: 'carFormStore/orderData',
                storeMethod: buildStoreMethod('state'),
            },
            carUploadList: {
                storePath: 'carFormStore/carUploadList',
                storeMethod: buildStoreMethod('state'),
            }
        },
        layout:{
            'grid-row': '1/2',
            'grid-column': '1/2',
        },
        style:{}
    },
    {
        name: 'carPersonalInfo',
        component: carPersonalInfo,
        propsData: {
            data:{
                storePath: 'carFormStore/orderData',
                storeMethod: buildStoreMethod('state'),
            }
        },
        layout:{
            'grid-row': '1/2',
            'grid-column': '2/3',
        },
        style:{}
    },
    {
        name: 'carPlan',
        component: carPlan,
        propsData:{
            data:{
                storePath: 'carFormStore/orderData',
                storeMethod: buildStoreMethod('state'),
            }
        },
        layout:{
            'grid-row': '1/2',
            'grid-column': '3/5',
        },
        style:{}
    },
    {
        name: 'carInfo',
        component: carInfo,
        propsData: {
            data:{
                storePath: 'carFormStore/orderData',
                storeMethod: buildStoreMethod('state'),
            },
            carModels:{
                storePath: 'carFormStore/carModules',
                storeMethod: buildStoreMethod('state'), 
            },
            currentDetailed: {
                storePath: 'carFormStore/currentDetailed',
                storeMethod: buildStoreMethod('getters'),
            },
            dangerPropbability: {
                storePath: 'carFormStore/dangerPropbability',
                storeMethod: buildStoreMethod('state'),
            },
            carDangerTableData: {
                storePath: 'carFormStore/carDangerTableData',
                storeMethod: buildStoreMethod('getters'),
            },
            carDangerAuxiliary: {
                storePath: 'carFormStore/carDangerAuxiliary',
                storeMethod: buildStoreMethod('getters'),
            }
        },
        layout:{
            'grid-row': '2/3',
            'grid-column': '1/3',
        },
        style:{}
    },
    {
        name: 'carCharging',
        component: carCharging,
        propsData: {

            chargingData: {
                storePath: 'carFormStore/chargingData',
                storeMethod: buildStoreMethod('state'),
            },
            hasKeys:{
                storePath: 'carFormStore/syChargingHasKeys',
                storeMethod: buildStoreMethod('getters'),
            },
            chargingSelectedCompany:{
                storePath: 'carFormStore/chargingSelectedCompany',
                storeMethod: buildStoreMethod('getters'),
            }


        },
        layout:{
            'grid-row': '2/2',
            'grid-column': '3/5',
        },
        style:{}
    },
    
];


export{
    formEdit,
    formReadonly
}